#ifndef _WINDOW_H
#define _WINDOW_H

#include "buffer.h"
#include "undo.h"
#include "list.h"

typedef struct window {
    buf_t *buf;
    buf_t *head_buf;
    buf_t *tail_buf;
    int num_cmds;
    int multiple;
    undo_cmd_t *undo_cmd;
    undo_cmd_t *redo_cmd;
    char *path;
    int is_saved;
    struct list_head list;
} window_t;

extern window_t * current_window;

window_t * window_new(const char *path);
void window_free(window_t *win);
void window_create_window(const char *path);
void window_remove_window(window_t *win);
window_t * window_next(window_t *win);
window_t * window_prev(window_t *win);
void window_current_next(void);
void window_current_prev(void);

#endif /* _WINDOW_H */
